package cn.jzq.kotoba.modules.designpattern.observer.weather;

import java.util.Observable;

/**
 * @author jzq
 * @date 2018/12/21 9:37
 */
public class WeatherData2 extends Observable {

    private Double temp;

    private Double humidity;

    private Double pressure;

    public WeatherData2() {
    }

    public void measurementsChanged() {
        super.setChanged();
        super.notifyObservers();
    }

    public void setMeasurements(Double temp, Double humidity, Double pressure) {
        this.temp = temp;
        this.humidity = humidity;
        this.pressure = pressure;
        measurementsChanged();
    }

    public Double getTemp() {
        return temp;
    }

    public Double getHumidity() {
        return humidity;
    }

    public Double getPressure() {
        return pressure;
    }
}
